1. Field of the Invention
The present invention generally relates to exchanging data on a bus between a shared buffer and one or more processors using a plurality of virtual channels and, more particularly to dynamic adjustment of credits used to allocate bandwidth of the bus to the virtual channels.
2. Description of the Related Art
A system on a chip (SOC) generally includes one or more integrated processor cores, some type of embedded memory, such as a cache shared between the processors cores, and peripheral interfaces, such as external bus interfaces, on a single chip to form a complete (or nearly complete) system. Often these systems include some type of buffer device used to store data passed between the SOC and an external device, such as an external memory controller. The buffer is typically shared between the processor cores of the SOC, which may pass data to and from the buffer pool over an internal bus as streams of data, commonly referred to as virtual channels.
Because the needs of each processor core may vary, many systems utilize a shared credit system to allocate bus bandwidth among the virtual channels. Typically, a pool of credits is allocated among the virtual channels, with each virtual channel allocated a certain number of credits, for example, based on an expected workload. In other words, each virtual channel's credit share determines its bus bandwidth relative to the other virtual channels. Typically, the credit allocation does not change (i.e., is static) over a given period, such as a power on cycle, or the running of a particular application. However, during this period changes in workload of the core processors may cause the current allocation to become non-optimal, for example, resulting in some of the virtual channels waiting a relatively long time to use the bus.
Accordingly, what is needed are methods and systems that dynamically re-allocate the credit shares among the virtual channels to allow the system to optimize itself to the current workload of the processor cores.